package org.intelli.dl.learn.order.feign;

import org.springframework.cloud.openfeign.FeignClient;
import org.springframework.web.bind.annotation.PostMapping;
import org.springframework.web.bind.annotation.RequestHeader;
import org.springframework.web.bind.annotation.RequestParam;

/**
 * @author: Michael
 * @date: 2025/4/21
 * @desc: 模拟不调用自己的服务，去调用指定url的，如阿里云的墨迹天气api
 */
@FeignClient(value = "weather-client", url = "http://aliv18.data.moji.com")
public interface WeatherClient {

    @PostMapping("/whapi/json/alicityweather/condition")
    String getWeather(@RequestHeader("Authorization") String auth,
                      @RequestParam("token") String token,
                      @RequestParam("cityId") String cityId);
}
